//
//  WorkerResumeIntentionInfoModel.m
//  Btpin
//
//  Created by Vic on 2019/3/27.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "WorkerResumeIntentionInfoModel.h"

@implementation WorkerResumeIntentionInfoModel

- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
    self.jobs = [NSMutableArray arrayWithCapacity:0];
    self.jobsStr = @"";
    if (keyedValues[@"jobs"] && [keyedValues[@"jobs"] count]) {
        for (NSString *str in keyedValues[@"jobs"]) {
            [self.jobs addObject:str];
            self.jobsStr = [NSString stringWithFormat:@"%@,%@", str, self.jobsStr];
        }
    }
    if (self.jobsStr && self.jobsStr.length>1) {
        self.jobsStr = [self.jobsStr substringToIndex:self.jobsStr.length-1];
    }
    
    self.wage_cn = [UIToolsControl dataAnalysis:keyedValues[@"wage_cn"]];
    self.district_cn = [NSMutableArray arrayWithCapacity:0];
    self.district_cnStr = @"";
    if (keyedValues[@"district_cn"] && [keyedValues[@"district_cn"] count]) {
        for (NSString *str in keyedValues[@"district_cn"]) {
            [self.district_cn addObject:str];
            self.district_cnStr = [NSString stringWithFormat:@"%@,%@", str, self.district_cnStr];
        }
    }
    self.trade_cn = [NSMutableArray arrayWithCapacity:0];
    self.trade_cnStr = @"";
    if (keyedValues[@"trade_cn"] && [keyedValues[@"trade_cn"] count]) {
        for (NSString *str in keyedValues[@"trade_cn"]) {
            [self.trade_cn addObject:str];
            self.trade_cnStr = [NSString stringWithFormat:@"%@,%@", str, self.trade_cnStr];
        }
    }
    if (self.trade_cnStr && self.trade_cnStr.length>1) {
        self.trade_cnStr = [self.trade_cnStr substringToIndex:self.trade_cnStr.length-1];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (id)copyWithZone:(NSZone *)zone {
    WorkerResumeIntentionInfoModel *model = [[[self class] allocWithZone:zone] init];
    model.jobs = [NSMutableArray arrayWithCapacity:0];
    [model.jobs addObjectsFromArray:self.jobs];
    model.wage_cn = self.wage_cn;
    model.district_cn = [NSMutableArray arrayWithCapacity:0];
    [model.district_cn addObjectsFromArray:self.district_cn];
    model.trade_cn = [NSMutableArray arrayWithCapacity:0];
    [model.trade_cn addObjectsFromArray:self.trade_cn];
    
    return model;
}

@end
